package com.kede.dictenum;

import com.kede.annotation.DictEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/***
 ** @Author:Pr.li
 ** @Description:
 ** @Date: create in 2023/4/19 15:30
 ***/
@Getter
@AllArgsConstructor
public enum AreaDictEnum implements DictEnum {
    province(1,"省/直辖市/自治区"),
    ciry(2,"市"),
    area(3,"区/县");

    Integer value;
    String label;


    @Override
    public String getLabelStr() {
        return label;
    }

    @Override
    public String getValueStr() {
        return value.toString();
    }

    @Override
    public String getName() {
        return "area_level";
    }

    @Override
    public String getDes() {
        return "省 市区/县字典";
    }



    /**
     * 根据value 获取当前枚举
     *
     * @Author: Pr.li
     * @Date: 2023/4/20 11:04
     * @Param: [int]
     * @Return: MaterialOutEnterEnum
     ***/
    public static AreaDictEnum valueOfCode(Integer value) {
        for (AreaDictEnum it : AreaDictEnum.values()) {
            if (it.getValue().equals(value)) {
                return it;
            }
        }
        return null;
    }

}
